//
//  LiveShowDataVideoScrollView.m
//
//
//  Created by DK on 17/1/18.
//  Copyright © 2017年 ChunYu. All rights reserved.
//

#import "LiveShowDataVideoScrollView.h"

@implementation LiveShowDataVideoScrollView

- (instancetype)initWithVideoData:(NSDictionary *)videoData{
    
    if (self = [super init]) {
        
        // 先取到数据，计算图片高宽，然后，让label自适应高度，计算高度，取最大高度，计算scroll的高度-决定view高度。

        // 绿色线
        // title
        // 线
        // scroll
        // videoView
        // selected框
        
        
        
    }
    return self;
}
@end

//-----------------------------------------------------------------
@implementation LiveShowDataVideoImageTitleView
#define UnSelectColor  FFA800
#define SelectColor    323232

- (instancetype)initWithWidth:(CGFloat)width ItemData:(NSDictionary *)itemData{
    
    if (self = [super init]) {
        // 图片
        CGFloat imageH = width*75/90.0;
        UIImageView *videoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, width, imageH)];
        [self addSubview:videoImageView];
        
        // 半透明标题view
        CGFloat alphaViewH = width*24/75.0;
        UIView *alphaView = [[UIView alloc]initWithFrame:CGRectMake(0, imageH-alphaViewH, width,alphaViewH)];
        [videoImageView addSubview:alphaView];
        
        // 时间展示
        UILabel *timeLabel = [[UILabel alloc]initWithFrame:alphaView.bounds];
        timeLabel.font = [UIFont systemFontOfSize:13.0];
//        timeLabel.textColor = ;
        timeLabel.textAlignment = NSTextAlignmentRight;
        [alphaView addSubview:timeLabel];
        
        CGFloat videoImageBottom = CGRectGetMaxY(videoImageView.frame);
        CGFloat space = 10;
        
        UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, videoImageBottom, width, 0)];
        titleLabel.numberOfLines = 0;
        titleLabel.font = [UIFont systemFontOfSize:13.0];
//        titleLabel.textColor = ;
        titleLabel.text = @"";
        [alphaView addSubview:timeLabel];
        
        [titleLabel sizeToFit];
        
//        CGFloat totalHeight = imageH + space + titleLabel.height;
//        self.height = totalHeight;
        
        
    }
    return self;
}

@end
